package com.gdut.huayan.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gdut.huayan.validation.NumRange;
import com.gdut.huayan.validation.group.GroupAdd;
import com.gdut.huayan.validation.group.GroupUpdate;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;


@Data
@EqualsAndHashCode(callSuper = false)
@TableName("t_name")
public class Name implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @Null(groups = {GroupAdd.class})
    @NotNull(groups = {GroupUpdate.class})
    private Long id;

    private Long charityId;

    private Long tabletId;

    /**
     * 1-往生先人，2-阳上，3-慈善人姓名， 4-地基主
     */
    @NumRange(min = 1,max = 3,message = "名字类型错误")
    private Integer type;

    @NotBlank(message = "牌位上的名字不能为空")
    private String text;


}
